﻿using SqlSugar;

namespace Blog.Model
{
	public class Article:BaseId
	{
		[SqlSugar.SugarColumn(ColumnDataType ="nvarchar(50)")]
		public string? Title { get; set; }

		[SqlSugar.SugarColumn(ColumnDataType = "text")]
		public string? Content { get; set; }
		public DateTime CreationTime { get; set; }

		[SqlSugar.SugarColumn(ColumnDataType = "int")]
		public int ViewCount { get; set; }

		[SqlSugar.SugarColumn(ColumnDataType = "int")]
		public int LikeCount { get; set; }

		[SqlSugar.SugarColumn(ColumnDataType = "int")]
		public int DisLikeCount { get; set; }

		[SqlSugar.SugarColumn(ColumnDataType = "int")]
		public int CollectCount { get; set; }

		[SqlSugar.SugarColumn(ColumnDataType = "tinyint")]
		public int IsCheck { get; set; }

		public int ArticleTypeID { get; set; }
		public int AuthorID { get; set; }
        //导航属性
        //映射的时候要忽略
        [SqlSugar.SugarColumn(IsIgnore = true)]
		public ArticleType? ArticleType { get; set; }

		[SqlSugar.SugarColumn(IsIgnore = true)]
		public Author? Author { get; set; }

		[SqlSugar.SugarColumn(IsIgnore = true)]

		[Navigate(NavigateType.OneToMany, nameof(Comment.ArticleID),nameof(Id))]
		public List<Comment>? Comments { get; set; }

	}
}
